/**
 * json配置举例，更多配置请看 IConfigSchema
 * @author luguoxiang
 * @date 2022/7/5
 * 开源项目：https://gitee.com/lgx1992/lg-soar 求star！请给我star！请帮我点个star！
 */
import { FilterTypeEnum, IConfigSchema, LgDictProps } from '@/soar';

const fieldList: IConfigSchema<any>[] = [
  {
    field: 'avatar',
    label: '头像',
    dataType: 'img',
    params: 'url',
    search: false,
    table: {
      width: 60,
    },
    form: false,
  },
  {
    field: 'nickname',
    label: '昵称',
    dataType: 'string',
    form: false,
    search: {
      searchType: FilterTypeEnum.CUSTOM,
    },
  },
  {
    field: 'username',
    label: '账号',
    dataType: 'string',
    table: {
      sorter: true,
    },
    form: false,
    search: {
      searchType: FilterTypeEnum.CUSTOM,
    },
  },
  {
    field: 'status',
    label: '状态',
    dataType: 'dict',
    params: 'user-status', // 字符串配置选项，值是索引
    table: {
      width: 100,
      sorter: true,
    },
    search: {
      componentProps: {
        component: 't-radio-group',
      } as LgDictProps,
      searchType: FilterTypeEnum.CUSTOM,
    },
    form: false,
    detail: {
      colProps: {
        style: '--lg-grid-min: 9; --lg-grid-max: 9',
      },
    },
  },
];

export default fieldList;
